package com.camemax.rabbitmq.work_mode.fair;

import com.camemax.rabbitmq.utils.ConsumersModulesRunnable;

import java.util.concurrent.TimeUnit;

// *********************
// ** @Date: 2021-06-09
// ** @Author: Camemax
// ** @Description: [Special] Consumer consume the messages from Publisher in work mode [by Fair].
// *********************
public class WorkFair_Consumer{
    private static final String QUEUE_NAME = "work-queue";
    private static final String CONSUMER_A = "WMFC_A"; // WMFC = Work Mode Fair Consumer
    private static final String CONSUMER_B = "WMFC_B"; // WMFC = Work Mode Fair Consumer
    public static void main(String[] args) {
        new Thread(new WorkFairConsumerRunnable(QUEUE_NAME, 100),CONSUMER_A).start(); // 延迟100ms
        new Thread(new WorkFairConsumerRunnable(QUEUE_NAME),CONSUMER_B).start(); // 默认延迟1000ms
    }
}
